package com.hkjtgc.pcr_app.dao

import androidx.room.*
import com.hkjtgc.pcr_app.model.TodoInfoDO

@Dao
interface TodoDao {

    @Query("SELECT * FROM todo")
    suspend fun getAll() : List<TodoInfoDO>?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(vararg todo: TodoInfoDO)

    @Query("SELECT *FROM todo WHERE id = :id")
    suspend fun findById(id: Int): TodoInfoDO?

    @Delete
    fun delete(todoInfoDO: TodoInfoDO)

}